package com.mjk.common.ai.entity;

import com.mjk.common.base.model.BaseEntity;
import com.mjk.common.core.jdbc.annotation.ArcSharding;
import com.mjk.common.core.jdbc.annotation.Filed;
import com.mjk.common.core.jdbc.annotation.Id;
import com.mjk.common.core.jdbc.service.idgenerator.IdGenerateType;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 * ConversationMessage对象
 *
 * @author moyz
 * @since 2023-04-11
 */
@Data
@ArcSharding(dataSource = "pg", table = "adi_conversation_message")
public class ConversationMessage extends BaseEntity {
    @Id(type = IdGenerateType.AUTO_UUID)
    private Long id;

    @Filed(cloum = "create_time")
    private LocalDateTime createTime;

    @Filed(cloum = "update_time")
    private LocalDateTime updateTime;

    @Filed(cloum = "is_deleted", comment = "是否删除（0：未删除，1：已删除）")
    private Boolean isDeleted;

    @Filed(cloum = "uuid", comment = "消息的uuid")
    private String uuid;

    @Filed(cloum = "parent_message_id", comment = "父级消息id")
    private Long parentMessageId;

    @Filed(cloum = "conversation_id", comment = "对话id")
    private Long conversationId;

    @Filed(cloum = "conversation_uuid", comment = "对话uuid")
    private String conversationUuid;

    @Filed(cloum = "user_id", comment = "用户id")
    private Long userId;

    @Filed(cloum = "remark", comment = "对话的消息")
    private String remark;

    @Filed(cloum = "message_role", comment = "产生该消息的角色：1: 用户,2:系统,3:助手")
    private Integer messageRole;

    @Filed(cloum = "tokens", comment = "消耗的token数量")
    private Integer tokens;

    @Filed(cloum = "understand_context_msg_pair_num", comment = "上下文理解中携带的消息对数量（提示词及回复）")
    private Integer understandContextMsgPairNum;

    @Filed(cloum = "ai_model_id", comment = "adi_ai_model id")
    private Long aiModelId;

    @Filed(cloum = "attachments", comment = "附件列表")
    private String attachments;
}
